<!DOCTYPE html>
<html lang="en">
<head>
	{{template "pc/public/mycss.html" .}}
</head>
<style type="text/css">
	#wrapper{
		background: #f5f5f5!important;
	}
	.header-center{
		background: #fff;
	}
	.user_left{
		background: #fff;
	}
	.fenlei{
		width: 20%;
	}
	
	@media (max-width: 992px){
		.fenlei{
		    width: 100%;
		}
	}
	.orderReturn .returnInput dl:nth-of-type(1) dd p{width: calc(100% - 95px);float:right;}
	.orderReturn .returnInput dl:nth-of-type(1) dd{width: calc(100% - 80px);float: right;padding: 10px;}
	.orderReturn .returnInput dl:nth-of-type(1) dd:nth-of-type(odd){border-top: 1px dashed #eee}
	.orderReturn .returnInput dl:nth-of-type(1) dd input{border: 0;border-bottom: 1px solid #333;padding-left: 10px;width: 80px;}
	p.bfd{color: #e31939;font-weight: 600;font-size: 16px;}
	#content h1{font-size: 16px;padding: 15px 30px 0;}
	#content h1 .iconfont{font-size: 20px;}
	.returnInput button{border-radius: 3px;color: #fff;background:#e31939;padding: 5px 10px; width: 100px;border: 0;margin-left: 80px;margin-top: 20px;}
</style>
<body class="common-home res layout-home1 orderReturn">
<div id="wrapper" class="wrapper-full banners-effect-7">
	<!-- Header Container  -->
	{{template "pc/public/head.html" .}}
  	{{template "pc/public/mytop.html" .}}
	<div class="main-container container">
		<div class="row mb-50">
			<!--Left Part Start -->
			{{template "pc/public/myleft.html" .}}
			<!--Middle Part Start-->
			<div id="content" class="col-md-10 col-sm-8 right mt-15">
				<a href="/shop?id={{.info.gid}}">
				<h1>
					<span class="mui-icon iconfont">&#xe75f;</span> 
					{{$.system.name}}
				</h1>
				</a>
				<div class="returnInput">
					<form>
					<dl>
						<dt>退款商品：</dt>
						{{range .info.shopcar}}
						<dd><img src="{{.pathname}}" alt="">
							<p>{{.title}}</p>
							<p>
								规格 : {{.number}}{{.spec}}/箱<br>
								型号 : {{.model}}<br>
							</p>
							<p class="bfd">￥ {{.price}}
								<span class="fr">
								{{if eq .status "3" "4"}}
								{{if eq .num .sendnum}}
								x{{.num}}
								{{else}}
								实发{{.sendnum}}/{{.num}}
								{{end}}
								{{else}}
								x{{.num}}
								{{end}}
								</span>
							</p>
						</dd>
						<dd>退货数量 <input type="number" name="shopcar" value="{{if .rinfo}}{{.rnum}}{{else}}1{{end}}" placeholder="请输入您要退换的数量"></dd>
						{{end}}
					</dl>
					<dl>
						<dt>申请类型：</dt>
						{{ if eq .info.isre 1 }}
						<dd>
							<p><input type="radio" name="type" value="0" {{if .rinfo}}{{if .rinfo.type "0"}}checked{{end}}{{else}}checked{{end}}><span>退货</span></p>
							<p><input type="radio" name="type" value="1" {{if .rinfo}}{{if .rinfo.type "1"}}checked{{end}}{{end}}><span>换货</span></p>
						</dd>
						{{ else if eq .info.isre 2 }}
						<dd>
							<p><input type="radio" name="type" value="0" checked><span>退货</span></p>
						</dd>
						{{ else if eq .info.isre 3 }}
						<dd>
							<p><input type="radio" name="type" value="1" checked><span>换货</span></p>
						</dd>
						{{end}}
					</dl>
					<dl>
						<dt>退款原因：</dt>
						<dd>
							<select name="why">
								{{range .why}}
								<option value="{{.id}}" {{if $.rinfo}}{{if eq $.rinfo.why .id}}selected{{end}}{{end}}>{{.name}}</option>
								{{end}}
							</select>
						</dd>
					</dl>

					<dl>
						<dt>退款说明：</dt>
						<dd>
							<textarea name="intr" cols="60" rows="6" placeholder="退款说明">{{.rinfo.intr}}</textarea>
						</dd>
					</dl>
					<input type="hidden" name="oid" value="{{.info.id}}" id="oid">
					<input type="hidden" name="rid" value="{{.rinfo.id}}">
				</form>
					<button id="up">提交</button>
				</div>
			</div>
		</div>
	</div>
</div>

<!-- Footer Container -->

{{template "pc/public/foot.html" .}}
{{template "pc/public/myfoot.html" .}}
<script type="text/javascript">
	$('#up').click(function(){
		var form=$('form').serialize()
		 wxc.xcConfirm("确定申请退货吗?","confirm",{onOk:function(){
	      $.ajax({
	        url:window.location.href,
	        data:form,
	        type:'post',
	        success:function(res) {
	          if(res==1){
	          	wxc.xcConfirm("提交成功，请等待卖家处理","info",{onClose:function(){
	            history.go(0)
	          	}})
	          }else if(res==0){
	            showToast('网络繁忙,请重试');
	          } else{
	            showToast('该订单已经申请过退款');
	          }
	        }
	      })  
	    }});
	})
</script>
</body>
</html>

